/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package shipwright.parts;

import com.jme3.asset.AssetManager;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.bullet.joints.PhysicsJoint;
import com.jme3.bullet.joints.Point2PointJoint;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;

/**
 *
 * @author root
 */
public class BoatFactory {
    
     public static Node buildBoat(AssetManager am){
        Node boat = new Node();
        Geometry block = BoatBlock.buildBoatBlock(am);
        boat.attachChild(block);
        RigidBodyControl rbc = new RigidBodyControl(BoatBlock.mass);
        block.addControl(rbc);
  
        
        block = BoatBlock.buildBoatBlock(am);
        boat.attachChild(block);
        boat.setLocalTranslation(.5f,0,0);
        RigidBodyControl rbc2 = new RigidBodyControl(BoatBlock.mass);
        block.addControl(rbc2);
        
         PhysicsJoint joint = new Point2PointJoint(rbc, rbc2, new Vector3f(0f,0,0), new Vector3f(0,0,0));
        
         
        return boat;
    }
    
}
